<?php 
session_start();
if (isset($_POST['fdes'])){
    $openid=trim(addslashes($_POST['fdes']));
	 
	include_once("../c/config.php");
	$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
	if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
	$sql="select mid,nianji from check3 where openid='".$openid."' limit 0, 1";
	$query=$mysqli->query($sql);
    if($query->num_rows>0){
        $getC=$query->fetch_assoc();
        $nianji=$getC['nianji'];
        $_SESSION['nianji']=$nianji;
        $mingTable='m3';
        if(3 == $nianji){
            $mingTable='m3';
        }
        if(4 == $nianji){
            $mingTable='m4';
        }
        if(5 == $nianji){
            $mingTable='m5';
        }
        if(6 == $nianji){
            $mingTable='m6';
        }
        $sql="select name,phone,qu,school from ".$mingTable." where id='".$getC['mid']."' limit 0, 1";
        $queryU=$mysqli->query($sql);
        $getU=$queryU->fetch_assoc();
        echo json_encode(array('s'=>'ok',
            'ne'=>$getU['name'],'p'=>$getU['phone'],'nj'=>$nianji,'q'=>$getU['qu'],'x'=>$getU['school']));
    }else{
        echo json_encode(array('s'=>'not'));
    }
    $mysqli->close();
}else{
    echo json_encode(array('s'=>'not'));
}
?>